<template >
    <label class="swap swap-rotate">
        <input type="checkbox" v-model="check"
            data-toggle-theme="light,dark"  data-act-class="ACTIVECLASS"/>
        <i :class="['bi-sun','swap-on']"></i>
        <i :class="['bi-moon-fill','swap-off']"></i>    
        
    </label>
</template>
<script setup>
import { onMounted, ref } from 'vue'
import { themeChange } from 'theme-change'

let check = ref()

onMounted(()=>{
    if(!localStorage.getItem('theme')){
        check.value = localStorage.getItem('theme') === "dark"
    }
    themeChange(check)
})
</script>